package com.ls.demo;

import com.ls.demo.http.server.HttpServer;
import com.ls.demo.tcp.server.NettyTcpServer;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

import javax.annotation.Resource;

/**
 * @author liShan
 * @date 2019/8/28
 */
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class})
public class DemoApplication implements CommandLineRunner {

    @Resource
    private NettyTcpServer nettyTcpServer;

    @Resource
    private HttpServer httpServer;

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @Override
    public void run(String... args) {
        new Thread(nettyTcpServer).start();
        new Thread(httpServer).start();
    }

}
